package com.day5;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;

@WebServlet(urlPatterns = {"/init_params02"},initParams = {
        @WebInitParam(name = "name", value = "hello"),
        @WebInitParam(name = "name2", value = "world")
})
public class InitParams02 extends HttpServlet {

    @Override
    public void init() throws ServletException {
        ServletConfig servletConfig = getServletConfig();
        String name = servletConfig.getInitParameter("name");
        String name2 = servletConfig.getInitParameter("name2");
        System.out.println(name + " " + name2 + "!");
    }
}
